<?
function checkLogin($db) {
	if($_COOKIE['snadminName']&&$_COOKIE['snadminPwd']){
		include_once(dirname(__FILE__)."/login.php");
		$result = false;
		$result = login($_COOKIE['snadminName'],$_COOKIE['snadminPwd'],$db);
		if($result) {
			@setcookie("snadminName",$_COOKIE['snadminName'],time()+3600);
			@setcookie("snadminPwd" ,$_COOKIE['snadminPwd'] ,time()+3600);
		}
		
		return $result;
	}
	else {
		return false;
	}
}